﻿@model ShippingMethodModel
@using Telerik.Web.Mvc.UI;

@Html.ValidationSummary(true)
@Html.HiddenFor(model => model.Id)

@Html.SmartStore().TabStrip().Name("shipping-method-edit").Style(TabsStyle.Material).Items(x =>
{
	x.Add().Text(T("Admin.Common.General").Text).Content(TabGeneral()).Selected(true);

	EngineContext.Current.Resolve<IEventPublisher>().Publish(new TabStripCreated(x, "shipping-method-edit", this.Html, this.Model));
})

@helper TabGeneral()
{
	@(Html.LocalizedEditor<ShippingMethodModel, ShippingMethodLocalizedModel>("shipping-method-localized",
	@<table class="adminContent">
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Locales[item].Name)
			</td>
			<td class="adminData">
				@*IMPORTANT: Do not delete, this hidden element contains the id to assign localized values to the corresponding language *@
				@Html.HiddenFor(model => model.Locales[item].LanguageId)

				@Html.EditorFor(model => Model.Locales[item].Name)
				@Html.ValidationMessageFor(model => model.Locales[item].Name)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Locales[item].Description)
			</td>
			<td class="adminData wide">
				@Html.EditorFor(model => model.Locales[item].Description, "Html")
				@Html.ValidationMessageFor(model => model.Locales[item].Description)
			</td>
		</tr>
	</table>
	,
	@<table class="adminContent">
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Name)
			</td>
			<td class="adminData">
				@Html.EditorFor(model => model.Name)
				@Html.ValidationMessageFor(model => model.Name)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Description)
			</td>
			<td class="adminData wide">
				@Html.EditorFor(model => model.Description, "Html")
				@Html.ValidationMessageFor(model => model.Description)
			</td>
		</tr>
	</table>
	))

	<table class="adminContent">
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.DisplayOrder)
			</td>
			<td class="adminData">
				@Html.EditorFor(model => model.DisplayOrder)
				@Html.ValidationMessageFor(model => model.DisplayOrder)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.IgnoreCharges)
			</td>
			<td class="adminData">
				@Html.EditorFor(model => model.IgnoreCharges)
				@Html.ValidationMessageFor(model => model.IgnoreCharges)
			</td>
		</tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.SelectedStoreIds)
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.SelectedStoreIds)
                @Html.ValidationMessageFor(model => model.SelectedStoreIds)
            </td>
        </tr>
        <tr>
            <td class="adminTitle">
                @Html.SmartLabelFor(model => model.SelectedRuleSetIds)
            </td>
            <td class="adminData">
                @Html.EditorFor(model => model.SelectedRuleSetIds)
                @Html.ValidationMessageFor(model => model.SelectedRuleSetIds)
            </td>
        </tr>
	</table>
}